const express = require('express');
const bodyParser = require('body-parser');
const app = express();
const router = express.Router();
router.use(bodyParser.urlencoded({ extended: true }));
//数据库连接
router.use(require('./db.js'))
//加载路由回调函数
const users = require('./contrallor/users.js');
const Person = require('./contrallor/Person.js');

//查询
router.get('/users', users.index)
//插入
router.post('/users/add', users.add)
//更新
router.post('/users/edit', users.edit)
//删除
router.get('/users/del', users.del)
//找到数据
router.get('/users/find', users.find)
router.get('/users/say', users.say)

router.get('/abc',Person.say);

module.exports = router;